import java.util.*;

public class Main {
    // mkdir
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        while (in.hasNextInt()) {
            int n = in.nextInt();
            List<String> list = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                list.add(in.next());
            }
            Collections.sort(list);
            int sz = list.size();
            for (int i = 1; i < sz; i++) {
                if ((list.get(i).contains(list.get(i-1)) && list.get(i).charAt(list.get(i-1).length()) == '/')) {
                    list.set(i-1, "");
                }
            }

            for (String s : list) {
                if (!s.equals("")) {
                    System.out.println("mkdir -p " + s);
                }
            }
            System.out.println();
        }
    }




    // 数据库连接池
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);

        while (in.hasNext()) {
            int n = in.nextInt();
            int count = 0;
            int res = 0;

            for (int i = 0; i < n; i++) {
                String s1 = in.next();
                String s2 = in.next();
                if (s2.equals("connect")) {
                    count++;
                } else {
                    count--;
                }
                res = Math.max(res, count);
            }
            System.out.println(res);
        }
    }
}
